package com.centit.suixuan.puremvc
{
	import com.centit.suixuan.puremvc.controller.MainCommand;
	import com.centit.suixuan.puremvc.controller.MenuCommand;
	import com.centit.suixuan.puremvc.controller.ImageCommand;
	import com.centit.suixuan.puremvc.controller.DataGridCommand;
	
	import org.puremvc.as3.interfaces.IFacade;
	import org.puremvc.as3.patterns.facade.Facade;

	public class AppFacade extends Facade implements IFacade
	{
		public static const APP_STARTUP:String = "app_startup";
		public static const MENU_STARTUP:String = "menu_startup";
		public static const IMAGE_STARTUP:String = "Image_startup";
		public static const DATAGRID_STARTUP:String = "Datagrid_startup";
		public function AppFacade()
		{
		}
		
		
		public static function getInstance() : AppFacade{
			if(null == instance){
				instance = new AppFacade();
			}
			
			return instance as AppFacade;
		}
		
		override protected function initializeController():void {
			super.initializeController();
			//register some Commands
			registerCommand(APP_STARTUP, MainCommand);
			registerCommand(MENU_STARTUP, MenuCommand);
			registerCommand(IMAGE_STARTUP, ImageCommand);
			registerCommand(DATAGRID_STARTUP, DataGridCommand);
			
		}
	
		public function start(mainApp : Object) : void {
			super.sendNotification(APP_STARTUP, mainApp);
			super.sendNotification(MENU_STARTUP, mainApp);
			
			
		}
	}
}